<%--
  Created by IntelliJ IDEA.
  User: QiangweiLuo
  Date: 12/22/2018
  Time: 12:54 PM
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>发布新投票</title>
    <link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/css/style.css" />
</head>
<body>
<%@include file="top.jsp"%>

<div id="voteManage" class="box" data-genuitec-lp-enabled="false" data-genuitec-file-id="wc3-0" data-genuitec-path="/VoteSite/WebRoot/add.jsp">
    <h2>修改投票</h2>
    <div class="content">
        <form method="post" action="${pageContext.request.contextPath}/list/modify?method=modify">
            <dl>
                <dt>投票内容：</dt>
                <dd>
                    <input type="hidden" name="id" value="${subject.id}"/>
                    <label>
                        <input type="text" class="input-text" name="title" id="title" value="${subject.title}">
                    </label>
                </dd>
                <dt>开始时间：</dt>
                <dd>
                    <label>
                        <input type="datetime-local" class="input-text" name="startDate" id="startDate" value="${subject.startTimeView}">
                    </label>
                </dd>
                <dt>结束时间：</dt>
                <dd>
                    <label>
                        <input type="datetime-local" class="input-text" name="endDate" id="endDate" value="${subject.endTimeView}">
                    </label>
                </dd>
                <dt>投票类型：</dt>
                <dd>
                    <label>
                        <input type="radio" name="voteType" <c:if test='${subject.number == 1}'>checked</c:if> value="1" disabled="disabled">
                    </label>单选
                    <label>
                        <input type="radio" name="voteType" <c:if test='${subject.number == 2}'>checked</c:if> value="2" disabled="disabled">
                    </label>多选
                </dd>
                <dt>投票选项：</dt>

                <dd id="voteoptions">
                    <c:forEach items="${subject.options}" var="option">
                        <p>
                            <label>
                                <input type="text" class="input-text" name="options" value="${option.content }" disabled="disabled">
                            </label>
                        </p>
                    </c:forEach>
                </dd>
                <dt></dt>
                <dd class="button">
                    <input type="image" src="${pageContext.request.contextPath}/images/button_submit.gif" alt="提交">
                    <a href="${pageContext.request.contextPath}/list/modify?method=delete&id=${subject.id}">删除此投票</a>
                </dd>
            </dl>
        </form>
    </div>
</div>
<div class="error" id="error">${error }</div>
<div id="footer" class="wrap">
    艾特优软件 &copy; 版权所有
</div>
<script type="text/javascript" src="${pageContext.request.contextPath}/scripts/jquery-3.2.1.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/scripts/modifyPage.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/scripts/heartbeat.js"></script>
</body>
</html>
